#
# $Id$
# $HeadURL$
#
set -e

#!includefile=<common.startup>

#!includefile=<common.helpers>

#!includefile=<common.paths>
#!includefile=<common.appprops>

#set +e

if [ -f $APPPATH/conf/$SCRIPTNAME.options ]; then

  #!includefile=<common.params>

  common_initParams "$@"
  ExitIfErr "Cannot initialize parameter parser"

  common_COMMANDLINEPARAMS=""
  common_parseParams N "$@"
  ExitIfErr "Cannot parse command line"

  if [ -f $APPPATH/conf/$SCRIPTNAME.defopts ]; then
    eval common_parseParams Y $(<$APPPATH/conf/$SCRIPTNAME.defopts)
    ExitIfErr "Cannot parse default optinos"
  fi

  if [ "$common_HELPONLY" = "Y" ]; then
    common_CONSOLEOUTPUT="Y"
    common_loaded="Y"
    usage
    exit
  fi

  common_checkParams
  ExitIfErr "Cannot check parameters"

fi

common_loaded="Y"
set +e

